<template>
	<view class="content">
		<view  class="zwyHeightSec but" @tap="toOpen">调用键盘一</view>
		<jpKeyboard ref="jpKeyboard" :keyImg="a4"></jpKeyboard>
		
		<view  class="zwyHeightSec but" @tap="toOpen1">调用键盘二</view>
		<jpKeyboard ref="jpKeyboard1" keyType="two"></jpKeyboard>
		
		<view  class="zwyHeightSec but" @tap="toOpen2">调用键盘二数字打散</view>
		<jpKeyboard ref="jpKeyboard2" :keyImg="a4" :random="true"></jpKeyboard>
		
		<view  class="zwyHeightSec but" @tap="toOpen3">调用键盘四</view>
		<jpKeyboard ref="jpKeyboard3" keyType="two" :keyImg="a4" :random="true"></jpKeyboard>
	</view>
</template>

<script>
	import jpKeyboard from '@/components/jp-keyboard/jp-keyboard.vue';
	export default {
		components: {
			jpKeyboard
		},
		data() {
			return {
				// a4: require('@/static/004.jpg'),
				a4:'',
				codes: '',
				codes2: ''
			}
		},
		methods: {
			toOpen() {
				this.$refs.jpKeyboard.toOpen()
			},
			toOpen1() {
				this.$refs.jpKeyboard1.toOpen()
			},
			toOpen2() {
				this.$refs.jpKeyboard2.toOpen()
			},
			toOpen3() {
				this.$refs.jpKeyboard3.toOpen()
			},
		}
	}
</script>

<style>
	.content {
		margin-left: 200rpx;
		width: 350rpx;
		display: flex;
		justify-content: center;
		flex-wrap: wrap;
	}

	.but {
		margin: 10rpx 0;
		width: 280rpx;
		height: 60rpx;
		line-height: 60rpx;
		background-color: #007AFF;
		border-radius: 30rpx;
		font-size: 26rpx;
		color: #fff;
		text-align: center;
	}

	@keyframes zwyHeightSec {
		100% {
			background-position: right -40px top 0px;
		}
	}

	.zwyHeightSec {
		position: relative;
		overflow: hidden;
	}

	.zwyHeightSec::before {
		content: '';
		position: absolute;
		width: 100%;
		height: 100%;
		left: 0;
		right: 0;
		top: 0;
		bottom: 0;
		margin: auto;
		background-image: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0));
		background-size: 40px 100%;
		background-repeat: no-repeat;
		background-position: left -40px top 0;
		animation: zwyHeightSec 1s ease infinite;
	}
</style>
